<template>
  <view class="my-top" v-if="nums?.length">
    <swiper class="swiper" vertical autoplay :interval="2000" :duration="500" circular>
      <swiper-item v-for="(item, index) in nums" :key="index">
        <view class="t-con" @click="toMember">
          <image src="@/static/my/news.svg" style="width:32rpx;height:32rpx;margin-right:10rpx"></image>
          <view style="flex: 1">剩余{{item.day_look}}个免费次数，{{item.end_time}}天后过期，请尽快使用!</view>
          <uni-icons type="right" size="14" color="#FF5C55" style="margin-right: 30rpx"></uni-icons>
        </view>
      </swiper-item>
    </swiper>
  </view>
</template>
 
<script setup>
const props = defineProps({
  nums: {
    type: Array,
    default: () => [],
  },
});
const toMember = () => {
  uni.navigateTo({ url: "/subPages/member/index" });
};
</script>
 
<style lang='scss' scoped>
.my-top {
  height: 80rpx;
  font-weight: bold;
  font-size: 28rpx;
  color: #f65952;
  line-height: 40rpx;
  padding-left: 30rpx;
  background: linear-gradient(180deg, transparent 0%, #ffefee 100%);
  border-radius: 10rpx 10rpx 10rpx 10rpx;
  border: 1rpx solid #ff5c55;
  margin: 0 20rpx;
}

.swiper {
  height: 80rpx;
}

.t-con {
  width: 100%;
  height: 80rpx;
  display: flex;
  align-items: center;
}
</style>